package com.gopay.common.cps.dao.cbrmb.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.cbrmb.CbRmbWildCardAssistDtlDAO;
import com.gopay.common.domain.cbrmb.internationalcard.CbRmbWildCardAssistDtl;

/**
 * 跨境人民币 外卡支付辅助表DAO实现类
 * @CbRmbWildCardAssistDtlDAOImpl.java
 * @author lailingyu
 * @2017-10-27 上午10:03:10  www.gopay.com.cn Inc.All rights reserved.
 */
@Repository(value = "cbRmbWildCardAssistDtlDAO")
public class CbRmbWildCardAssistDtlDAOImpl extends BaseDAOImpl<CbRmbWildCardAssistDtl, Long>
        implements CbRmbWildCardAssistDtlDAO {

    @Override
    public CbRmbWildCardAssistDtl findByGopayOrderId(String gopayOrderId) {
        String hql = "from CbRmbWildCardAssistDtl where gopayOrderId =:gopayOrderId";
        Map<String, Object> param = new HashMap<>();
        param.put("gopayOrderId", gopayOrderId);
        List<CbRmbWildCardAssistDtl> list = findByHql(hql, param);
        if (list != null && list.size() > 0) {
            return list.get(0);
        } else {
            return null;
        }
    }

}
